#include			"Game.hpp"
#include			"GameObject.hpp"

std::map<int, GameObject*>*	Game::_mapObj = 0;

void			Game::initMap(const std::string& map)
{
	Game::_mapObj = new std::map<int, GameObject*>;
    Animation* anim = new Animation("img\\r-typesheet7a.png", 32,32, true, 40);
	Animation* anim2 = new Animation("img\\explosion32.png", 32,32, false, 20);
	GameObject* lol = new GameObject(0, Player, 0, 1, 100, 100, *anim, *anim2);

	Game::_mapObj->insert(std::pair<int, GameObject*>(lol->getId(), lol));
}

void			Game::launchMap()
{}

GameObject*		Game::getObject(const int& id)
{
	if (Game::_mapObj->count(id) == 0)
		return (0);
	return ((Game::_mapObj->find(id))->second);	
}